//
//  MBFlashViewController.m
//  MbAdsSdk_Example
//
//  Created by 吴奶强 on 2022/1/10.
//  Copyright © 2022 吴奶强. All rights reserved.
//

#import "MBFlashViewController.h"
#import "MbFlashAd.h"
#import "SVProgressHUD.h"

@interface MBFlashViewController ()<FlashAdDelegate>
@property(nonatomic,strong)MbFlashAd *mbFlashAd;

@end

@implementation MBFlashViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSMutableArray * adItems = [NSMutableArray new];
    AdItem * adItem = [[AdItem alloc]init];
    [adItem setData:Pangolin codeNo:@"887546715"];
//    [adItem setData:GDT codeNo:@"7002033659199976"];
//    [adItem setData:KS codeNo:@"7235000170"];
    //[adItem setData:GroMore codeNo:@"887574940"];

    
    [adItems addObject:adItem];
    self.mbFlashAd = [MbFlashAd new];
    self.mbFlashAd.adItems = adItems;
    self.mbFlashAd.rootVC = self;
    self.mbFlashAd.delegate = self;
    [self.mbFlashAd loadFlash];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

#pragma mark - 开屏回调
- (void)splashAdDidLoad{
    [SVProgressHUD showImage:nil status:@"开屏加载成功"];
}

- (void)splashAdDidClick{
    [SVProgressHUD showImage:nil status:@"开屏点击"];
}
- (void)splashAdDidClose{
    [SVProgressHUD showImage:nil status:@"开屏结束"];
    [self dismissViewControllerAnimated:NO completion:nil];
}

- (void)splashAdDidError:(NSError *)error{
    [self dismissViewControllerAnimated:NO completion:nil];
    [SVProgressHUD showImage:nil status:[NSString stringWithFormat:@"%ld",error.code]];
}

@end
